package com.hugui.stock.configuration;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 股票API配置类
 */
@Configuration
@ConfigurationProperties(prefix = "stock.api")
public class StockApiConfig {
    
    /**
     * 默认使用的API类型
     * 可选值：tencent, eastmoney
     */
    private String defaultApi = "tencent";
    
    /**
     * 是否启用API降级
     * 当主API失败时，自动切换到备用API
     */
    private boolean enableFallback = true;
    
    /**
     * API请求超时时间（毫秒）
     */
    private int timeout = 10000;
    
    /**
     * 请求间隔时间（毫秒）
     */
    private int requestInterval = 1000;
    
    /**
     * 批量请求间隔时间（毫秒）
     */
    private int batchInterval = 100000;

    public String getDefaultApi() {
        return defaultApi;
    }

    public void setDefaultApi(String defaultApi) {
        this.defaultApi = defaultApi;
    }

    public boolean isEnableFallback() {
        return enableFallback;
    }

    public void setEnableFallback(boolean enableFallback) {
        this.enableFallback = enableFallback;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public int getRequestInterval() {
        return requestInterval;
    }

    public void setRequestInterval(int requestInterval) {
        this.requestInterval = requestInterval;
    }

    public int getBatchInterval() {
        return batchInterval;
    }

    public void setBatchInterval(int batchInterval) {
        this.batchInterval = batchInterval;
    }
} 